﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MineCraft_Update
{
    class SvnStatus
    {
        public static List<string> FindFiles(string str)
        {
            List<string> badfiles = new List<string>();
            Console.WriteLine("Sent: " + str);
            //do
            {
                if (!str.Contains("Summary") && !str.Contains(">") && !str.StartsWith(" "))
                {
                    //Console.WriteLine(str.StartsWith("M"));
                    if (str.StartsWith("D") || str.StartsWith("M") || str.StartsWith("!") || str.StartsWith("?"))
                    {
                        badfiles.Add(str.Substring(0, 1));
                        badfiles.Add(str.Substring(8, str.Length - 8));
                    }
                    else
                    {
                        badfiles.Add(str.Substring(0, 1));
                        badfiles.Add(str.Substring(8, str.Length - 8));
                    }

                }
                //else if (str.Contains(">"))
                //{
                    //return new List<string>( 'b' );
                //}
                else
                {
                    Console.WriteLine("Found {>}");
                    return null;
                }
            }
            //while(true);
            return badfiles;
        }

        public static string FindFiles2(string str)
        {
            string foundstring = null;
            Console.WriteLine(str + " end");
            //do
            //{
                if (!str.Contains("Summary") && !str.Contains(">"))
                {
                    Console.WriteLine(str.StartsWith("M"));
                    if (str.StartsWith("D") || str.StartsWith("M"))
                    {
                        foundstring = str.Substring(8, str.Length-8);
                    }

                }
                else if (str.Contains(">")) 
                {
                    return "blah";
                }
                else
                {
                    //Console.WriteLine("Found {>}");
                    return null;
                }
            //}
            //while (true);
            return foundstring;
        }
    }
}
